package com.newly.center.business.api;

import com.newly.api.business.feign.DataScreenClient;
import com.newly.center.business.service.CheckRecordService;
import com.newly.center.business.service.DataScreenService;
import com.newly.common.base.constants.ServerUriConstant;
import com.newly.common.base.entity.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @anthor sbq
 * @date 2021/11/4 10:02
 */
@RestController
@RequestMapping(ServerUriConstant.NEWLY_BUSINESS_DATA_SCREEN)
public class DataScreenController implements DataScreenClient {

    @Autowired
    private DataScreenService dataScreenService;

    @Autowired
    private CheckRecordService checkRecordService;

    @Override
    public R dataScreenCount(Integer offset) {

        return R.ok(this.dataScreenService.count(offset));
    }

    @Override
    public R getRealTimeData(Integer limit) {
        return R.ok(checkRecordService.getRealTimeData(limit));
    }
}
